|
The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal. == History== The VCL was developed by Borland for use in, and is tightly integrated with, its Delphi and C++Builder RAD tools. In 1995 Borland released Delphi, its first release of an Object Pascal IDE and language. Up until that point, Borland's Turbo Pascal for DOS and Windows was largely a procedural language, with minimal object-oriented features, and building UI frameworks with the language required using frameworks like Turbo Vision and Object Windows Library. OWL, a similar framework to MFC, required writing code to create UI objects. A key aim of the VCL combined with the Delphi language was to change the requirements of building a user interface. (For context, the Delphi variant of Pascal had a number of innovative object-oriented features, such as properties and runtime type information, inspired by Modula and Smalltalk.) At the time, much UI code work required creating classes inheriting from other classes, and customized objects were often not reusable (for example, a button that performs a specific action cannot be reused in a different application.)〔Delphi Component Design, Danny Thorpe, p9〕 UI code was also complicated, forcing the programmer to understand and use the Windows API, manage GDI resources, etc.〔Delphi Component Design, Danny Thorpe, p11〕 Finally, a visual user interface arguably should be designed visually, and yet most tools to do so - at the time, mainly Visual Basic - did so in terms of the designer outputting code, creating a fragile, un-manually-editable situation - a problem that still persists today with many UI frameworks, particularly C++-based ones such as Qt.〔http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html#compile-time-form-processing〕 The combination of the Delphi language and the VCL framework written in that language addressed these by: * A streaming framework, allowing an object and subobjects to be streamed to text or binary format - TComponent, the root class of the VCL framework * A form designer that saved to a stream, saving the description of the objects not the code required to create them, with objects capable of self-creation when streaming the description back in * Language features that allowed instances of a class to be customised without subclassing, in two ways: first, through the use of properties, allowing instances of an object to have its own fields (such as a caption) easily changed through streaming; second, by allowing events - method pointers called at specific places in code - to be handled by another object; that is the method pointers were attached to an object instance.〔http://docwiki.embarcadero.com/RADStudio/XE6/en/VCL_Overview#Using_Events〕 In other words, this creates "custom behaviours through delegation instead of inheritance".〔Delphi Component Design, Danny Thorpe, p12〕 * Controls that wrapped native Windows controls, in framework that managed resources〔http://docwiki.embarcadero.com/RADStudio/XE6/en/Understanding_the_Component_Library〕 The combination of these resulted in a visual designer that streamed a description; a form (window) that constructed itself from that description, including creating all the other components on that form; and code being written in one place (methods on the form) that could be called by UI elements in response to certain actions, such as a button being clicked calling an OnClick event handler implemented in the form code. At the time this was revolutionary, while today it is an approach used by several other frameworks, such as WinForms and Cocoa. This also allowed new components - new visual or non-visual classes - to be written easily. The VCL is Windows-based and its implementations of common controls are wrappers of the Windows API, thus is close to the ground and fully native. New controls can be implemented from scratch or can use existing Windows controls. With the release of C++ Builder, the Delphi compiler could emit C++ header files for compiled Delphi-language units, and so the flexibility of the streaming, visually designed UI framework became available for C++. VCL components can in fact be written in C++, but ultimately inherit from Delphi ancestors, since the C++Builder compiler and linker can consume object and header files produced by Delphi. This was one of the first examples of cross-language compatibility, something unseen until .Net. Today the VCL includes several hundred visual and non-visual components, usable in both the Delphi and C++ languages. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Visual Component Library」の詳細全文を読む スポンサード リンク
|